﻿<Window x:Class="ArchivumAeternumDesktop.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:my="clr-namespace:ArchivumAeternumDesktop"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <my:ListEditor DataContext="{Binding Tasks}" Grid.Row="1" Grid.RowSpan="2" Grid.Column="0" Margin="5,5,0,5" />
        <GridSplitter ResizeDirection="Columns" />
        <my:ListEditor DataContext="{Binding Sources}" Grid.Row="1" Grid.Column="1" Margin="15,5,5,5" />
        <my:ListEditor DataContext="{Binding Excludes}" Grid.Row="2" Grid.Column="1" Margin="15,5,5,5" />

        <Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="85" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="60" />
                <ColumnDefinition Width="50" />
            </Grid.ColumnDefinitions>

            <Label Content="Configuration: " Grid.Column="0" VerticalAlignment="Center" />
            <TextBox Text="{Binding ConfigFile, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" Grid.Column="1" Margin="5,5,0,5" />
            <Button Command="{Binding BrowseButton}" Content="Browse" Grid.Column="2" Margin="5,5,0,5" />
            <Button Command="{Binding SaveButton}" Content="Save" Grid.Column="3" Margin="5,5,5,5" />
        </Grid>

        <Grid Grid.Column="2" Grid.Row="1" Grid.RowSpan="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <StackPanel Orientation="Vertical" Grid.Row="0">
                <Label Content="Destination:" Margin="10,5,0,0" />
                <TextBox Text="{Binding Destination}" Margin="10,-1,5,0" />

                <Label Content="File comparison:" Margin="10,10,5,0"/>
                <CheckBox Content="File size" IsChecked="{Binding ComparisonByFileSize}" Margin="10,5,5,0" />
                <CheckBox Content="Modification date" IsChecked="{Binding ComparisonByModificationDate}"  Margin="10,5,5,0" />
                <CheckBox Content="CheckSum (SHA-512)" IsChecked="{Binding ComparisonByCheckSum}"  Margin="10,5,5,0" />
            </StackPanel>
            <StackPanel Orientation="Vertical" Grid.Row="1">
                <Button Content="Start selected task" Command="{Binding StartSelectedTaskCommand}" Margin="10,20,5,0" />
                <Button Content="Start all tasks" Command="{Binding StartAllTaskCommand}" Margin="10,5,5,5" />
            </StackPanel>
        </Grid>

        <Grid Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="70" />
            </Grid.ColumnDefinitions>
            
            <Label Content="{Binding Status}" Grid.Column="0" Margin="5,5,0,5" />
            <Button Content="View log" Command="{Binding ViewLogCommand}" Grid.Column="1" Margin="5,5,5,5"/>
        </Grid>
    </Grid>
</Window>
